import { Devcloud } from "../apiClass"
import { IResult } from "../../plugins/Interfaces"


export class ModuleApi extends Devcloud {
  private baseUrl: string = this.path + 'module/';
  async insert(param:any):Promise<IResult> {
    const resp = await this.client.post(this.baseUrl + "insert", param)
    return resp.data
  }
  async delete(id:string):Promise<IResult> {
    const resp = await this.client.get(this.baseUrl + "delete", {id:id})
    return resp.data
  }
  async moduleListBuildRunPageVo(projectId:number, moduleId?:number):Promise<IResult> {
    const resp = await this.client.get(this.baseUrl + "moduleListBuildRunPageVo", {projectId: projectId, moduleId:moduleId})
    return resp.data
  }
  async moduleBuildRunPageVo(moduleId:number):Promise<IResult> {
    const resp = await this.client.get(this.baseUrl + "moduleBuildRunPageVo", {moduleId: moduleId})
    return resp.data
  }
}